import store from '@/store'

//判断用户是否拥有操作权限
export function hasPermission (v){
    let perms = v.substring(1, v.length) + '_write'
    // if(process.env.NODE_ENV == "development"){
    //     return true;
    // }else{
        let hasPermission = false;
        let permissions = store.state.user.perms;
        for(let i = 0; i < permissions.length; i++) {
            if(permissions[i].numUrl === perms || permissions[i].menuCode === perms) {
                hasPermission = true;
                break;
            }
        }
        return hasPermission;
    // }

    
}